package com.aidex.biz.domain;

import com.aidex.common.annotation.Excel;
import com.aidex.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.util.Date;

/**
 * 用户领券信息对象 biz_user_coupon
 * @author sean
 * @email 2074844820@qq.com
 * @date 2023-07-02
 */
@Data
public class UserCoupon extends BaseEntity<UserCoupon>
{
    private static final long serialVersionUID = 1L;

    /** 券ID */
    @Excel(name = "券ID")
    private String couponId;

    /** 会员ID */
    @Excel(name = "会员ID")
    private String userInfoId;

    /** 排序 */
    private Integer sort;

    /** 状态0 待使用 1已经使用 2已过期 */
    @NotBlank(message = "状态0 待使用 1已经使用 2已过期不允许为空")
    private String status;

    /**
     * 过期时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date outTime;

    /**
     * 使用时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date useTime;

    private CouponInfo couponInfo;

    private String fullSub;
    private Integer type;


    public void setCouponId(String couponId) 
    {
        this.couponId = couponId;
    }

    public String getCouponId() 
    {
        return couponId;
    }

    public void setUserInfoId(String userInfoId) 
    {
        this.userInfoId = userInfoId;
    }

    public String getUserInfoId() 
    {
        return userInfoId;
    }

    public void setSort(Integer sort) 
    {
        this.sort = sort;
    }

    public Integer getSort() 
    {
        return sort;
    }

    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("userId", getUserId())
            .append("deptId", getDeptId())
            .append("userName", getUserName())
            .append("deptName", getDeptName())
            .append("companyId", getCompanyId())
            .append("couponId", getCouponId())
            .append("userInfoId", getUserInfoId())
            .append("sort", getSort())
            .append("status", getStatus())
            .append("remark", getRemark())
            .append("id", getId())
            .append("createBy", getCreateBy())
            .append("createDept", getCreateDept())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("updateIp", getUpdateIp())
            .append("version", getVersion())
            .append("delFlag", getDelFlag())
            .toString();
    }
}
